package com.jeasonzhao.model;

import com.jeasonzhao.commons.json.JSONClass;
import com.jeasonzhao.commons.xml.XMLNode;

public abstract class AbstractModelItem implements IExModelItem
{
    private static final long serialVersionUID = 1L;
    public void afterInitializedFromXML(XMLNode nodeItem)
        throws ModelException
    {
        //this function is used to provider a extra initialization for bean when initializing from a XML statement
        //Do not code anything here.
    }

    public void afterInitializedFromJSON(JSONClass nodeItem)
        throws ModelException
    {
        //this function is used to provider a extra initialization for bean when initializing from a XML statement
        //Do not code anything here.
    }

    public void afterConvertToXML(XMLNode returnNode)
        throws ModelException
    {
        //this function is used to provider a extra initialization for bean when save to XML
        //Do not code anything here.
    }

    public void afterConvertToJSON(JSONClass returnNode)
        throws ModelException
    {
        //this function is used to provider a extra initialization for bean when save to XML
        //Do not code anything here.
    }

    public void afterInitializedFromDatabase()
        throws ModelException
    {

    }

    public void normalizeModelItem()
        throws ModelException
    {
        //Call sequence: Helper Function->FromJSON/FromXML/FromDatabase->[normalize]
        //This function is used to normalize the members in current item,
        //and is invoked when finished initialization from XML,JSON or database.
        //DO NOT Code anything here, this is a skeleton.
    }

}
